<?php
use yii\helpers\Html;
use yii\helpers\Url;
/* @var $this yii\web\View */
$this->title = '提现';
?>
<section id="body_h">
		<div class="modular17">
			<div class="modular15">
				<p class="balance">注意：</p>
				<p>1. 每日提现上限为 30 万元；</p>
				<p>2. 每日 16:00 前申请的提现当日处理，之后申请次工作日处理；</p>
				<p>3. 充值 15 日内未进行投资的资金（不含活动标）提现，需收取 5‰；</p>
			</div>
			<ul class="modular8">
				<li>
					<p class="modular8-left">银行账号</p>
					<p class="modular8-right"><span class="color9"><?php if($userinfos){$len=mb_strlen($userinfos['account'],'utf-8');echo '***************'.mb_substr($userinfos['account'], $len-4);}?></span></p>
				</li>
				<li>
					<p class="modular8-left">银行名称</p>
					<p class="modular8-right"><span class="color9"><?php if ($userinfos){echo $userinfos['bank'];}?></span></p>
				</li>
				<li>
					<p class="modular8-left">开户行地址</p>
					<p class="modular8-right"><span class="color9"><?php if ($userinfos){echo $userinfos['address'];}?></span></p>
				</li>
				<li>
					<p class="modular8-left">真实姓名</p>
					<p class="modular8-right"><span class="color9"><?php if ($userinfos){echo $userinfos['realname'];}?></span></p>
				</li>
			</ul>
			<div class="modular12-con1from">
				<p class="balance">可用提现金额（元）：500</p>
				<form action="<?= Url::to(['withdraw/dowithdraw']);?>" method="post">
					<p class="twoelement greenborder"><input name="jine" class="changeelement" placeholder="提现金额" type="text"><span class="fixedelement1 greenborder Greencolor">元</span></p>
					<p class="oneelement greenborder"><input name="tipwd" class="changeelement" placeholder="提现密码" type="text"></p>
					<p class="modular12-con1ts4 clearfix"><a class="float-right" href="forget-stpassword.html">忘记投资密码？</a></p>
					<p class="mould-2bot form-ok"><input class="form-okbtn b-f" type="submit" value="提交"></p>
				</form>
			</div>
		</div>
		<div class="modular2">
			<p>如有任何疑问，请拨打客服电话 <span class="bluecolor">4006-900-880</span> <br>工作时间：09：00-17：30</p>
		</div>
		<div class="footer-h"></div>
</section>
	<section id="footer">
		<ul class="footer-nav clearfix">
		    <li class="current-bot">
		        <a href="index.html">
		            <img src="<?= Yii::getAlias('@web') . '/' ?>images/footer1-on.png" alt="">
		            首页
		        </a>
		    </li>
		    <li>
		        <a href="myaccount.html">
		            <img src="<?= Yii::getAlias('@web') . '/' ?>images/footer2.png" alt="">
		            我的账户
		        </a>
		    </li>
		    <li>
		        <a href="about-us.html">
		            <img src="<?= Yii::getAlias('@web') . '/' ?>images/footer3.png" alt="">
		            关于我们
		        </a>
		    </li>
		</ul>
	</section>
	<p id="tip-error"><span>表单验证错误信息</span></p>
<script>
	$(function($) {
	    var UA=window.navigator.userAgent;  //使用设备
	    var CLICK="click";
	    if(/ipad|iphone|android/.test(UA)){   //判断使用设备
	        CLICK="tap";
	    }
	    $(".form-okbtn").click(function(event){
            event.preventDefault(); //阻止默认提交表单
            var jine = $("input[name='jine']").val();
            var tipwd = $("input[name='tipwd']").val();
        	if(false){
				$('#tip-error span').html('原密码不能为空');
		        $('#tip-error').show();
		        setTimeout(function(){$('#tip-error').fadeOut(500);},1600);
        		$("input[name='prepassword']").focus();
        	}else if(false){
        		$('#tip-error span').html('新密码不能为空');
		        $('#tip-error').show();
		        setTimeout(function(){$('#tip-error').fadeOut(500);},1600);
        		$("input[name='password']").focus();
			}
			else
			{
				$.post(
						'<?= Url::to(['withdraw/dowithdraw']);?>',
						{jine:jine,tipwd:tipwd,'_csrf':'<?= yii::$app->request->getCsrfToken();?>'},
						function(data)
						{
							if(data == 'sKey无效！')
							{
								$('#tip-error span').html('请重新登录！');
						        $('#tip-error').show();
						        setTimeout(function(){$('#tip-error').fadeOut(500);},1600);
						        location.href='<?= Url::to(['site/signin']);?>';
							}
							else if(data == '投资密码修改成功！')
							{
								$('#tip-error span').html(data);
						        $('#tip-error').show();
						        setTimeout(function(){$('#tip-error').fadeOut(500);},1600);
						        location.href='<?= Url::to(['site/main']);?>';
							}
							else
							{
								$('#tip-error span').html(data);
						        $('#tip-error').show();
						        setTimeout(function(){$('#tip-error').fadeOut(500);},1600);
							}
						});
			}
		});
		$(".bodyA").hide();
	});
</script>